/*
 * @(#)QueryParameter.java
 * Date 2013-08-27
 * Version 1.0
 * Author Jim Horner
 * Copyright (c)2012
 */


package us.hornerscorners.lamppost.registry.model;

import java.util.ArrayList;
import java.util.List;

import us.hornerscorners.lamppost.registry.config.QueryParameterConfig;

import us.hornerscorners.lamppost.registry.constant.QuerySlotName;


/**
 *
 * @author jim
 */
public class QueryParameter {

    /** Field description */
    private final QueryParameterConfig parameterConfig;

    /** Field description */
    private final List<String> values;

    /**
     * Constructs ...
     *
     *
     * @param parameterConfig
     */
    public QueryParameter(QueryParameterConfig parameterConfig) {

        super();
        this.values = new ArrayList<>();

        if (parameterConfig == null) {
            
            throw new IllegalArgumentException("parameterConfig can not be null.");
        }

        this.parameterConfig = parameterConfig;
    }

    /**
     * Constructs ...
     *
     *
     * @param parameterConfig
     * @param values
     */
    public QueryParameter(QueryParameterConfig parameterConfig, List<String> values) {

        this(parameterConfig);
        this.values.addAll(values);
    }

    /**
     * Constructs ...
     *
     *
     * @param parameterConfig
     * @param value
     */
    public QueryParameter(QueryParameterConfig parameterConfig, String value) {

        this(parameterConfig);
        this.values.add(value);
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public QueryParameterConfig getParameterConfig() {
        return parameterConfig;
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public QuerySlotName getSlotName() {

        return this.parameterConfig.getSlotName();
    }

    /**
     * Method description
     *
     *
     * @return
     */
    public List<String> getValues() {
        return values;
    }
}
